package com.spring.mvc.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.spring.mvc.dao.NewsDAO;
import com.spring.mvc.mapper.NewsMapper;
import com.spring.mvc.pojo.CallResult;
import com.spring.mvc.pojo.News;

@Component
public class NewsDAOImpl implements NewsDAO {
	
	@Autowired
	private NewsMapper newsMapper;

	public CallResult getById(int id) {
		CallResult result=new CallResult();
		News news=newsMapper.getById(id);
		if(null != news){
			result.setObject(news);
		}
		return result;
	}

}
